﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WebApplication1.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class AddLouYuanTable : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "louyuan",
                columns: table => new
                {
                    louyuanid = table.Column<ushort>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    mingcheng = table.Column<string>(type: "TEXT(20)", maxLength: 20, nullable: false),
                    fangwushuliang = table.Column<int>(type: "INTEGER(4)", nullable: true),
                    dongshu = table.Column<int>(type: "INTEGER(3)", nullable: true),
                    jianzhumianji = table.Column<float>(type: "REAL(4,2)", nullable: true),
                    jianchengshijian = table.Column<string>(type: "TEXT(4)", maxLength: 4, nullable: true),
                    shequid = table.Column<ushort>(type: "INTEGER", nullable: true),
                    dizhi = table.Column<string>(type: "TEXT(50)", maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_louyuan", x => x.louyuanid);
                    table.ForeignKey(
                        name: "FK_louyuan_shequ_shequid",
                        column: x => x.shequid,
                        principalTable: "shequ",
                        principalColumn: "shequid");
                });

            migrationBuilder.CreateIndex(
                name: "IX_louyuan_shequid",
                table: "louyuan",
                column: "shequid");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "louyuan");
        }
    }
}
